<?php
require_once ('../util/Constants.php');
require_once('../dao/database.php');
require_once('../dao/user_db.php');
require_once('../domain/User.php');

if (isset($_SESSION[Constants::SESSION_ROLE])) {
    $benutzer = $_SESSION[Constants::SESSION_USER_NAME];
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="keywords" lang="de" content="Kilometerradln, Brunner's Wildes Kilometerradln, Radln, Gemeinde Brunn an der Wild, naturtankstelle">
        <title>Brunner Wildes Kilometer Radln</title>
        <link rel="stylesheet" type="text/css" href="<?php echo /* $base_path. */'/kilometerRadler/style/' ?>kilometer.css">
        <link rel="stylesheet" type="text/css" href="<?php echo /* $base_path. */'/kilometerRadler/style/' ?>jquery-ui-1.8.23.custom.css">
        <link rel="shortcut icon" type="image/x-icon" href="../img/favicon.ico">
        <script type="text/javascript" src="../script/jquery-1.8.0.min.js"></script>
        <script type="text/javascript" src="../script/jquery-ui-1.8.23.custom.min.js"></script>
        <script type="text/javascript" src="../script/Chart.js"></script>
        <style type="text/css">
            /*            body{
                            font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
                            font-size:12px;
                        }
                        p, h1, form, button{border:0; margin:0; padding:0;}
                        .spacer{clear:both; height:1px;}
                         ----------- My Form ----------- 
                        .myform{
                            margin:0 auto;
                            width:400px;
                            padding:14px;
                        }
            
                         ----------- stylized ----------- 
                        #stylized{
                            border:solid 2px #b7ddf2;
                            background:#ebf4fb;
                        }
                        #stylized h1 {
                            font-size:14px;
                            font-weight:bold;
                            margin-bottom:8px;
                        }
                        #stylized p{
                            font-size:11px;
                            color:#666666;
                            margin-bottom:20px;
                            border-bottom:solid 1px #b7ddf2;
                            padding-bottom:10px;
                        }
                        #stylized label{
                            display:block;
                            font-weight:bold;
                            text-align:right;
                            width:140px;
                            float:left;
                        }
                        #stylized .small{
                            color:#666666;
                            display:block;
                            font-size:11px;
                            font-weight:normal;
                            text-align:right;
                            width:140px;
                        }
                        #stylized input{
                            float:left;
                            font-size:12px;
                            padding:4px 2px;
                            border:solid 1px #aacfe4;
                            width:200px;
                            margin:2px 0 20px 10px;
                        }
                        #stylized button{
                            clear:both;
                            margin-left:150px;
                            width:125px;
                            height:31px;
                            background:#666666 url(img/button.png) no-repeat;
                            text-align:center;
                            line-height:31px;
                            color:#FFFFFF;
                            font-size:11px;
                            font-weight:bold;
                        }*/
        </style>
    </head>
    <body>
        <div style="width:940px; margin: 0 auto; background: white;">
            <div style="width:940px; margin: 0 auto; background: url(../img/zd_maindiv_shadow_left.png) top right repeat-y;">
                <div align="center" style="background: url(../img/zd_maindiv_shadow_right.png) top left repeat-y;">
                    <div id="Side">
                        <?php
                        require_once('header.php');
                        require_once('navigation.php');
                        require_once('../util/main.php');
                        ?>

                        <div id="Info">

                            <?php if (isset($_SESSION[Constants::SESSION_ROLE])) {
                                ?>
                                <div id="InfoBox">
                                    <h2 class="infoTitle">Benutzer</h2>
                                    <div id="InfoBoxEntry">
                                        <p><?php 
                                              echo $benutzer;  
                                           ?><br />
                                        </p>
                                    </div>
                                </div>
                                <?php
                            }
                            ?>



                            <div id="InfoBox">
                                <h2 class="infoTitle">Info-Box</h2>
                                <div id="InfoBoxEntry">
                                    <p><font color="#FF0000"><b>Der Kilometerradler startet wieder am 01.04.2014.</b></font><br />
                                    </p>
                                </div>
                                <div id="InfoBoxEntry">
                                    <p><b>Die Startveranstaltung des heurigen Kilometerradlers ist am 5. April 2014 um 14 Uhr am Gemeindeamt in Brunn.</b></font><br />
                                    </p>
                                </div>
<!--                                <div id="InfoBoxEntry">
                                    <p>Die Alterskategorie wurde auf das Geburtsjahr geändert. Bitte aktualisieren Sie Ihr Geburtsjahr über den Menüpunkt 'Benutzerdaten'.<br />
                                    </p>
                                </div>-->

                                <div id="InfoBoxEntry">
                                    <p>Weiter Information erhalten sie unter <a href="../info/infoView.php">Info</a><br />
                                    </p>
                                </div>
                            </div>
                            <div id="InfoBox">
                                <h2 class="infoTitle">Pinnwand</h2>

                                <?php
                                global $lastEntries;
                                foreach ($lastEntries as $lastEntry) {
                                    ?>
                                    <div id="InfoBoxEntry">
                                        <p><?php echo $lastEntry->getEintragVon() . ' "' . $lastEntry->getUser()->getNickname() . '":' ?></p> 
                                        <p><?php echo $lastEntry->getPinnwandEintrag() ?></p> 
                                    </div>    
                                    <?php
                                }
                                ?>
                                <div id="InfoBoxEntry">
                                    <p><a href="../pinnwand/pinnwand.php">weiter Einträge...</a></p> 
                                </div>    
                            </div>
                        </div>
